package castle.defense.project;

import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Window;
import android.view.WindowManager;

public class Highscore extends Activity {
	public static final int buttonBackground = 1893572;
	private static boolean internal = false;
	
	private HighscoreView hv;
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
	}
	
	@Override
	public void onResume() {
		SoundManager.setBackground(R.raw.medieval_menu);
		hv = new HighscoreView(this);
		this.setContentView(hv);
		super.onResume();
	}
	
	@Override
	public void onStop() {
		hv.stop();
		super.onStop();
	}
	
	@Override
	public void onPause() {
		if(!internal) {
			SoundManager.pauseBackground();
		} else {
			internal = false;
		}
		super.onPause();
	}
	
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent e) {
		if(keyCode==KeyEvent.KEYCODE_BACK) {
			Highscore.internal = true;
		}
		return super.onKeyDown(keyCode, e);
	}
}
